package com.springboot.manager.enums;

/**
 * @version v1.0
 * @ProjectName: manager
 * @ClassName: ResultCodeEnum
 * @Description: TODO(一句话描述该类的功能)
 * @Author: zhangzl
 * @Date: 2021-07-14 15:33
 */
public enum ResultCodeEnum {

    //成功
    SUCCESS(1, "SUCCESS"),
    //失败
    FAILURE(0, "FAILURE"),
    //异常错误
    EXCEPTION(-1, "EXCEPTION"),
    //服务降级
    FALLBACK(-2, "FALLBACK");

    private int code;
    private String msg;

    ResultCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public ResultCodeEnum setCode(int code) {
        this.code = code;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public ResultCodeEnum setMsg(String msg) {
        this.msg = msg;
        return this;
    }
}
